gsk: Avoid compiler warnings without assertions
authorMatthias Clasen <mclasen@redhat.com>
Mon, 12 Apr 2021 21:08:33 +0000 (17:08 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 13 Apr 2021 01:22:46 +0000 (21:22 -0400)
Disabling assertions was provoking some unused variable
warnings from the compiler. Avoid these.

gsk/gl/gskgldriver.c
gsk/gl/gskglrenderer.c

index e1d019c0296081078f8839446d4aeff2cb62ccee..621c25825c34905e57703536cfd9509d5091d8e0 100644 (file)
@@ -433,8 +433,6 @@ gsk_gl_driver_slice_texture (GskGLDriver   *self,
                              guint         *out_n_slices)
 {
   const int max_texture_size = gsk_gl_driver_get_max_texture_size (self) / 4; // XXX Too much?
-  const int tex_width = texture->width;
-  const int tex_height = texture->height;
   const int cols = (texture->width / max_texture_size) + 1;
   const int rows = (texture->height / max_texture_size) + 1;
   int col, row;
@@ -442,7 +440,7 @@ gsk_gl_driver_slice_texture (GskGLDriver   *self,
   TextureSlice *slices;
   Texture *tex;
 
-  g_assert (tex_width > max_texture_size || tex_height > max_texture_size);
+  g_assert (texture->width > max_texture_size || texture->height > max_texture_size);
 
 
   tex = gdk_texture_get_render_data (texture, self);
index c72cedaeb454dc0b474bfff79ca8f92f8339f59f..b7c2ac43c719ae4f071f989f280c2bd369d5adc1 100644 (file)
@@ -1997,12 +1997,11 @@ render_unblurred_inset_shadow_node (GskGLRenderer   *self,
                                     GskRenderNode   *node,
                                     RenderOpBuilder *builder)
 {
-  const float blur_radius = gsk_inset_shadow_node_get_blur_radius (node);
   const float dx = gsk_inset_shadow_node_get_dx (node);
   const float dy = gsk_inset_shadow_node_get_dy (node);
   const float spread = gsk_inset_shadow_node_get_spread (node);
 
-  g_assert (blur_radius == 0);
+  g_assert (gsk_inset_shadow_node_get_blur_radius (node) == 0);
 
   ops_set_program (builder, &self->programs->inset_shadow_program);
   ops_set_inset_shadow (builder, transform_rect (self, builder, gsk_inset_shadow_node_get_outline (node)),